package com.zhss.eshop.commodity.service.Impl;
import com.zhss.eshop.commodity.domain.dto.CommodityGoodsDTO;
import com.zhss.eshop.commodity.domain.dto.CommodityGoodsSkuDTO;
import com.zhss.eshop.commodity.service.CommodityService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * 商品中心对外接口service组件
 * @author suyuan
 *
 */
@Service
public class CommodityServiceImpl implements CommodityService {

	private static final Logger logger = LoggerFactory.getLogger(CommodityServiceImpl.class);


	/**
	 * 根据id查询商品sku
	 * @param goodsSkuId 商品sku id
	 * @return 商品sku DTO
	 */
	@Override
	public CommodityGoodsSkuDTO getGoodsSkuById(Long goodsSkuId) {
		try {
//			return goodsSkuService.getById(goodsSkuId);
			CommodityGoodsSkuDTO goodsSkuDTO=new CommodityGoodsSkuDTO();
			goodsSkuDTO.setId(999L);
			goodsSkuDTO.setGoodsId(111L);
			goodsSkuDTO.setSkuCode("");
			goodsSkuDTO.setGoodsName("");
			goodsSkuDTO.setGrossWeight(0.0D);
			goodsSkuDTO.setGoodsLength(0.0D);
			goodsSkuDTO.setGoodsWidth(0.0D);
			goodsSkuDTO.setGoodsHeight(0.0D);
			goodsSkuDTO.setGoodsSkuCode("");
			goodsSkuDTO.setSaleProperties("");
			goodsSkuDTO.setPurchasePrice(0.0D);
			goodsSkuDTO.setSalePrice(0.0D);
			goodsSkuDTO.setDiscountPrice(0.0D);
			goodsSkuDTO.setSaleStockQuantity(0L);
			goodsSkuDTO.setGmtCreate(new Date());
			goodsSkuDTO.setGmtModified(new Date());

			return goodsSkuDTO;

		} catch (Exception e) {
			logger.error("error", e);
			return null;
		}
	}

	@Override
	public CommodityGoodsDTO getGoodsById(Long goodsId) {
		return null;
	}
}
